package sctu.edu.java.year2016.team08.chenruixiu.day20160521.chapter6_1;

/**在项目中创建Number类，判断字符串“mingrikejijavabu”中字符'i'出现了几次，并将结果输出
 * Created by Administrator on 2016/5/21.
 */
public class Number {
    public static void main(String[] args){
        String s ="mingrikejijavabu";
        int n=0;
        int num=0;
        char b=105;
        for(n=0;n<16;n++){
            char mychar2=s.charAt(n);
            if(mychar2==b) {
                num = num + 1;
            }
        }
        System.out.println(num);
    }
}

